package org.example;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class FileSyncClient2 {
    private  static String PORT ;
    public static void main(String[] args) {
        // 远程服务端的主机名和端口号
        String serverHost = "127.0.0.1";
        int serverPort = 1234;

        try {
            // 连接远程服务端
            Socket socket = new Socket(serverHost, serverPort);

            // 获取服务端的输出流，并发送删除请求
            OutputStream outputStream = socket.getOutputStream();
            String deletedFileName = "D:\\clouder\\client\\12.txt";
            String deleteRequest = "DELETE " + deletedFileName;
            outputStream.write(deleteRequest.getBytes());

            // 关闭连接
            socket.close();

            System.out.println("客户端成功发送删除请求: " + deleteRequest);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
